<template>
    <div>
        <el-table
            :data="goods_type_list"
            style="width: 100%">
                <el-table-column
                    prop="name"
                    label="名称"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="equipment_id"
                    label="设备类型"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="desc"
                    label="描述"
                    width="180">
                </el-table-column>
                <el-table-column
                    prop="create_time"
                    label="创建时间">
                </el-table-column>
                <el-table-column
                    prop="create_time"
                    label="更新时间">
                </el-table-column>
                <el-table-column
                fixed="right"
                label="操作"
                width="100">
                <template slot-scope="scope">
                    <el-button
                    size="mini"
                    @click="handleEdit(scope.$index, scope.row)">编辑</el-button><br>
                    <el-button
                    size="mini"
                    type="danger"
                    @click="handleDelete(scope.$index, scope.row)">删除</el-button>
                </template>
                </el-table-column>
            </el-table>
    </div>
</template>

<script>
import {get_goods_type_list_get} from './axios_api/api.js'
export default {
    data() {
        return {
            
            goods_type_list: [],

        }
    },
    mounted() {
        this.get_goods_type_list()
    },
    methods: {
        handleEdit(index, row) {
            console.log(index, row);
        },
        handleDelete(index, row) {
            console.log(index, row);
            row.is_delete = 2
        },
        get_goods_type_list() {
            get_goods_type_list_get().then(res => {
                this.goods_type_list = res.goods_type_list
            })
        },
    }
}
</script>